package com.djstl;

import java.util.LinkedList;
import java.util.List;

public class Graph {
   static  class Cell{
	   
	   int cellnum;     // connect node
	   int weight;   // connect node with weight
	
	public Cell(int cell,int weight){
		this.cellnum=cell;this.weight=weight;
	}
	public int getCellNum() { return cellnum; }
	public int getWeight() { return weight; }
}
	private List<Cell>[] graphArr;
	public  List<Cell>[] getGraphList(){ return graphArr; }
    @SuppressWarnings("unchecked")
	public Graph(){
    	this.graphArr=new LinkedList[11];
    	init();
    }
    private void init(){ 
        
    	List<Cell> list0=new LinkedList<Cell>();
    	  list0.add(new Cell(1,3));
    	  list0.add(new Cell(4,1));
    	graphArr[0]=list0; 	
    	
    	List<Cell> list1=new LinkedList<Cell>();
    	   list1.add(new Cell(0,3));
           list1.add(new Cell(2,1));
           list1.add(new Cell(5,5));
		   list1.add(new Cell(6,3));
		   list1.add(new Cell(9,4));
    	graphArr[1]=list1; 
    	
    	List<Cell> list2=new LinkedList<Cell>();
    	  list2.add(new Cell(1,1));
		  list2.add(new Cell(3,1));
		  list2.add(new Cell(6,7));
    	graphArr[2]=list2; 
    	
    	List<Cell> list3=new LinkedList<Cell>();
    	  list3.add(new Cell(2,1));
		  list3.add(new Cell(10,2));
    	graphArr[3]=list3; 
    	
    	List<Cell> list4=new LinkedList<Cell>();
    	  list4.add(new Cell(0,1));
		  list4.add(new Cell(5,2));
    	graphArr[4]=list4; 
    	
    	List<Cell> list5=new LinkedList<Cell>();
        	list5.add(new Cell(1,5)); 
		    list5.add(new Cell(4,2));	 
		    list5.add(new Cell(7,2));
		    list5.add(new Cell(8,3));
    	graphArr[5]=list5;
    	
    	List<Cell> list6=new LinkedList<Cell>();
    	  list6.add(new Cell(1,3));
		  list6.add(new Cell(2,7)); 
		  list6.add(new Cell(8,2));
		  list6.add(new Cell(10,1));
    	graphArr[6]=list6;
    	
    	List<Cell> list7=new LinkedList<Cell>();
    	  list7.add(new Cell(5,2));
    	graphArr[7]=list7;
    	
    	List<Cell> list8=new LinkedList<Cell>();
    	  list8.add(new Cell(5,3));
		  list8.add(new Cell(6,2));
    	graphArr[8]=list8;
    	
    	List<Cell> list9=new LinkedList<Cell>();
    	  list9.add(new Cell(1,4));
		  list9.add(new Cell(10,2));
    	graphArr[9]=list9;
    	
    	List<Cell> list10=new LinkedList<Cell>();
    	  list10.add(new Cell(3,2));
		  list10.add(new Cell(6,1));
		  list10.add(new Cell(9,2));
    	graphArr[10]=list10;	
    }
}
